//
//  AIInfoSecondTableCell.m
//  Mia
//
//  Created by Vill on 2023/12/20.
//

#import "AIInfoSecondTableCell.h"


@implementation AIInfoSecondTableCell

+(instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *ID = @"AIInfoSecondTableCell";
    AIInfoSecondTableCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell == nil){
       cell = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].lastObject;
    }
    return cell;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    // 创建一个 NSMutableAttributedString 对象，设置占位符文字的属性
    NSString *placeholderText = @"Your date of birth *";
    self.birthLbl.textColor = [UIColor colorHex:@"#FFFFFF" alpha:0.5];
    NSMutableAttributedString *attributedPlaceholder = [[NSMutableAttributedString alloc] initWithString:placeholderText];
    [attributedPlaceholder addAttribute:NSFontAttributeName value:[UIFont fontWithWeight:MTBold size:PTW(20)] range:NSMakeRange(0, placeholderText.length)];
    // 设置星号的颜色为红色
    NSRange range = [placeholderText rangeOfString:@"*"];
    if (range.location != NSNotFound) {
        [attributedPlaceholder addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(range.location, 1)];
    }
    self.birthLbl.attributedText = attributedPlaceholder; // 设置新的占位符
    self.birthLbl.font = [UIFont fontWithWeight:MTBold size:PTW(20)];
}

//- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
//    [super setSelected:selected animated:animated];
//    if (selected){
//        // 如果箭头未旋转，则进行旋转
//        [UIView animateWithDuration:0.3 animations:^{
//            self.arrowBtn.transform = CGAffineTransformMakeRotation(M_PI_2);
//        }];
//    }else{
//        [UIView animateWithDuration:0.3 animations:^{
//            self.arrowBtn.transform = CGAffineTransformIdentity;
//        }];
//    }
//}

@end
